<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>业务模块-活动室预约人员</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="${s.base}/js/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="${s.base}/css/base/base.css" media="all" /></head>

<body class="childrenBody">
<form class="layui-form"  action="/webAreaUser/export"  method="post">
    <blockquote class="layui-elem-quote quoteBox" id="tool">
        <div class="layui-inline">
            <label class="layui-input-inline">活动室名称</label>
            <label class="layui-input-inline">
                <input type="text" class="layui-input" name="areaId" placeholder="请输入活动室名称" /></label>
            <label class="layui-input-inline">　姓名</label>
            <label class="layui-input-inline">
                <input type="text" class="layui-input" name="userName" placeholder="请输入姓名" /></label>
            <label class="layui-input-inline">手机号</label>
            <label class="layui-input-inline">
                <input type="text" class="layui-input" name="phone" placeholder="请输入手机号" /></label>
            <label class="layui-input-inline">审核状态</label>
            <label class="layui-input-inline">
                <select name="status" id="status"></select>
            </label>
            <div class="layui-inline">
                <a class="layui-btn search_btn" lay-submit="" lay-filter="seacherBtn">搜索</a>
                <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="exportBtn"  type="submit" >导出</button>
            </div>
        </div>
    </blockquote>
    <table id="entityList" lay-filter="entityList"></table>
</form>
<script type="text/html" id="entityBar">
    <a class="layui-btn cy-btnbg-edit layui-btn-sm" lay-event= "edit">审核</a>
</script>
<script type="text/javascript" src="${s.base}/js/layui/layui.js"></script>
<script type="text/javascript" src="${s.base}/js/base/base.js"></script>
<script type="text/javascript">layui.use(['jquery', 'pageUtil', 'table', 'dateUtil'],
    function() {
        var $ = layui.jquery,
            dateUtil = layui.dateUtil,
            table = layui.table,
            pageUtil = layui.pageUtil;
        var tableIns = null;
        pageUtil.initDict("base_check_status,web_week_day,web_time_solt,web_class_root,web_area_grade",
            function(dictData) {
                pageUtil.showDict($("#status"), pageUtil.aceeptDictContentList(dictData, "base_check_status"), "请选择审核状态");
                var url = "/webAreaUser/page";
                var cols = [{
                    type: 'checkbox',
                    fixed: 'left'
                },
                    {
                        type: 'numbers',
                        title: '序号'
                    },
                    {
                        field: 'areaName',
                        title: '活动室名称',
                        align: 'center'
                    },
                    {
                        field: 'startDate',
                        title: '开始日期',
                        width: 190,
                        align: 'center',
                        templet: function(d) {
                            return dateUtil.formatDate(new Date(d.startDate), "yyyy-MM-dd hh:mm:ss");
                        }
                    },
                    {
                        field: 'endDate',
                        title: '结束时间',
                        width: 190,
                        align: 'center',
                        templet: function(d) {
                            return dateUtil.formatDate(new Date(d.endDate), "yyyy-MM-dd hh:mm:ss");
                        }
                    },
                    {
                        field: 'userName',
                        title: '　姓名',
                        align: 'center'
                    },
                    {
                        field: 'phone',
                        title: '手机号',
                        align: 'center'
                    },
                    {
                        field: 'idCard',
                        title: '身份证',
                        align: 'center'
                    },
                    {
                        field: 'num',
                        title: '预约人数',
                        align: 'center'
                    },
                    {
                        field: 'weekDay',
                        title: '星期',
                        align: 'center',
                        templet: function(d) {
                            return pageUtil.aceeptDictContentName(dictData, 'web_week_day', d.weekDay);
                        }
                    },
                    {
                        field: 'timeSlot',
                        title: '时间段',
                        align: 'center',
                        templet: function(d) {
                            return  pageUtil.aceeptDictContentName(dictData, 'web_time_solt', d.timeSlot);
                        }
                    },
                    {
                        field: 'classRoom',
                        title: '教室',
                        align: 'center',
                        templet: function(d) {
                            return pageUtil.aceeptDictContentName(dictData, 'web_class_root', d.classRoom);
                        }
                    },
                    {
                        field: 'status',
                        title: '审核状态',
                        align: 'center',
                        templet: function(d) {
                            return pageUtil.aceeptDictContentName(dictData, 'base_check_status', d.status);
                        }
                    },
                    {
                        field: 'checkTime',
                        title: '审核时间',
                        width: 190,
                        align: 'center',
                        templet: function(d) {
                            if(d.status=='1'){
                                return ""
                            }else{
                                return dateUtil.formatDate(new Date(d.checkTime), "yyyy-MM-dd hh:mm:ss");
                            }

                        }
                    },
                    {
                        field: 'checkRemark',
                        title: '审核备注',
                        align: 'center',
                        templet: function(d) {
                            if(d.status=='1'){
                                return ""
                            }else{
                                return d.checkRemark;
                            }

                        }
                    },
                    {
                        field: 'createTime',
                        title: '创建时间',
                        width: 190,
                        align: 'center',
                        templet: function(d) {
                            return dateUtil.formatDate(new Date(d.createTime), "yyyy-MM-dd hh:mm:ss");
                        }
                    },
                    {
                        title: '操作',
                        width: 150,
                        templet: '#entityBar',
                        align: "center",
                        fixed: 'right'
                    }];
                tableIns = pageUtil.initDate(cols, url, true);
            });
        table.on('tool(entityList)',
            function(obj) {
                var layEvent = obj.event,
                    data = obj.data;
                if (layEvent === 'edit') {
                    pageUtil.editPopup("编辑", "/webAreaUser/getEntity?id=" + data.id);
                } else if (layEvent === 'del') {
                    pageUtil.delete("确定删除该项吗？", "/webAreaUser/delete", {
                            "id": data.id,
                            "_method": "DELETE"
                        },
                        function(data) {
                            tableIns.reload();
                        });
                }
            });
    })</script>
</body>

</html>